
<template>
    <div class="student">
        <h3>学生姓名：{{studentName}}</h3>
        <button @click="sendStudentName">把学生名发送给School组件</button>
    </div>
</template>

<script>
    export default {
        name: 'student',
        data() {
            return {
                studentName: "Brx"
                }
            },
        methods: {
            sendStudentName(){
                this.$bus.$emit("demoLine", this.studentName)
            }
        },
        }
</script>
<style scoped>
    .student{
        background-color: brown;
        padding: 5px;
    }
</style>